import Ajax from "./Ajax"
import { ADD_ORG, ADD_ROLE, DELETE_ROLE, DEL_ORG, EDIT_ORG, LOGIN_URL, ORG_LIST, ROLE_LIST, ROLE_UPDATE, USER_INFO, USER_LIST, USER_MENU, USER_RIGHTS } from "./url.config"

export function userInfoApi(params) {
    return Ajax({
        url: USER_INFO,
        params
    })
}
export function userRightsApi(params) {
    return Ajax({
        url: USER_RIGHTS,
        params
    })
}
export function userMenuApi() {
    return Ajax({url: USER_MENU})
}
export function userListApi(params) {
    return Ajax({
        url: USER_LIST,
        params
    })
}

export function roleListApi(params) {  
    return Ajax({
        url:ROLE_LIST,
        params
    })
}
export function delRoleApi(id) {  
    return Ajax({
        url:DELETE_ROLE + id,
        method:'DELETE',
    })
}
export function addRoleApi(data) {  
    return Ajax({
        url:ADD_ROLE,
        method:'PUT',
        data
    })
}
export function updateRoleApi(data) {  
    return Ajax({
        url:ROLE_UPDATE,
        method:'post',
        data
    })
}
export function orgListApi(params) {  
    return Ajax({
        url:ORG_LIST,
        params
    })
}
export function delOrgApi(id) {  
    return Ajax({
        url:DEL_ORG + id,
        method:'DELETE'
    })
}
export function addOrgApi(data) {  
    return Ajax({
        url:ADD_ORG,
        method:'put',
        data
    })
}
export function editOrgApi(data) {  
    return Ajax({
        url:EDIT_ORG,
        method:'POST',
        data
    })
}



